package crp.core.portal.domain.models;

import crp.core.shared.PublicStatus;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;

import java.util.List;
import java.util.Set;

@Getter
@AllArgsConstructor
@Builder
public class PortalSectionCourseLoadContext {
    private final List<SectionWithConfig> sections;
    private final Integer limit;
    private final Set<PublicStatus> publicStatuses;

    public PortalSectionCourseLoadContext merge(SectionWithConfig section) {
        this.sections.add(section);
        return this;
    }

    @Getter
    @AllArgsConstructor
    @Builder
    public static final class SectionWithConfig {
        private final String sectionId;
        private final PortalSectionConfig config;

        public PortalSectionLoadStrategy getLoadStrategy() {
            return config.getLoadStrategy();
        }
    }
}
